//文档加载事件 echarts
$(function(){
   var pie_china =echarts.init(document.getElementById("pie_now"),'infographic');
    $.ajax({
        url:"../info/queryAllCount",
        dataType:"json",
        type:"post",
        success:function (data) {
            option = {
                tooltip: {
                    trigger: 'item'
                },
                legend: {
                    //设置纵向显示
                    orient:'vertical',
                    top: '5%',
                    left: 'right',
                    textStyle: {color: 'balck'}
                },
                series: [
                    {
                        name: '今日国内疫情分析',
                        type: 'pie',
                        radius: ['40%', '70%'],
                        avoidLabelOverlap: false,
                        itemStyle: {
                            borderRadius: 10,
                            borderColor: '#fff',
                            borderWidth: 2
                        },
                        label: {
                            show: false,
                            position: 'center'
                        },
                        emphasis: {
                            label: {
                                show: true,
                                fontSize: '20',
                                fontWeight: 'bold'
                            }
                        },
                        labelLine: {
                            show: false
                        },
                        data: data
                    }
                ]
            };
            pie_china.setOption(option);
        },error:function () {
            layer.alert("服务器错误");
        }
    })
})